//https://ac.nowcoder.com/acm/problem/260770
//小红的子串

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int l = scanner.nextInt();
        int r = scanner.nextInt();
        char[] str = scanner.next().toCharArray();
        int[] hash = new int[128];
        long sum1 = 0, sum2 = 0, count = 0;
        for(int i = 0, j = 0; i<n; i++) {
            if(hash[str[i]] == 0) {
                count++;
            }
            hash[str[i]] ++;
            while (count > r) {
                hash[str[j]]--;
                if(hash[str[j]] == 0) {
                    count--;
                }
                j++;
            }
            sum1 += i-j+1;
        }

        count = 0;
        Arrays.fill(hash,0);
        for(int i = 0, j = 0; i<n; i++) {
            if(hash[str[i]] == 0) {
                count++;
            }
            hash[str[i]] ++;
            while (count > l-1) {
                hash[str[j]]--;
                if(hash[str[j]] == 0) {
                    count--;
                }
                j++;
            }
            sum2 += i-j+1;
        }

//        System.out.println(sum1);
//        System.out.println(sum2);
        System.out.println(sum1-sum2);
    }
}

/*

滑动窗口


 */